﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SpaceSquirrel.Automation
{
	public class RocketBikeAutomation : SpriteAutomation
	{
		public RocketBikeAutomation(Sprite sprite)
			: base(sprite)
		{ }

		public override void DoStuff(PlayScene scene)
		{
			Sprite p = scene.Player;
			int dx = p.x - this.sprite.x;
			int dy = p.y - this.sprite.y;
			if (dx * dx + dy * dy < 100)
			{
				if (((SpaceSquirrel.SpecialLevelStuff.BirdFeeder)scene.special[0]).seedsLeft == 0)
				{
					scene.Next = new PlayScene("bike_level", 8, 7, scene.Context);
				}
			}
		}
	}
}
